package com.shenmazong.controller;

import com.shenmazong.service.TbGoodsService;
import com.shenmazong.utils.ResultResponse;
import com.shenmazong.vo.PageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 军哥
 * @version 1.0
 * @description: TODO
 * @date 2022/1/17 15:04
 */

@RestController
@Slf4j
@RequestMapping(value = "/goods")
@Api(tags = "商家商品管理API")
public class TbGoodsController {

    @Autowired
    TbGoodsService tbGoodsService;

    @ApiOperation(value = "增加商品")
    @PostMapping(value = "/add")
    public ResultResponse add() {
        return null;
    }

    @ApiOperation(value = "删除商品")
    @PostMapping(value = "/del")
    public ResultResponse del() {
        return null;
    }

    @ApiOperation(value = "修改商品")
    @PostMapping(value = "/set")
    public ResultResponse set() {
        return null;
    }

    @ApiOperation(value = "根据ID获取商品信息")
    @PostMapping(value = "/getGoodsById")
    public ResultResponse getGoodsById() {
        return null;
    }

    @ApiOperation(value = "分页获取商品信息")
    @PostMapping(value = "/getGoodsByPage")
    public ResultResponse getGoodsByPage(@RequestBody PageVo pageVo) {
        return tbGoodsService.getGoodsByPage(pageVo);
    }

    @ApiOperation(value = "修改商品上架下架状态")
    @PostMapping(value = "/setMarketable")
    public ResultResponse setMarketable() {
        return null;
    }

    @ApiOperation(value = "测试增加商品")
    @PostMapping(value = "/testSet")
    public ResultResponse testSet() {
        return tbGoodsService.testSet();
    }

}
